/*

  Munipack


  Copyright © 2009-2011 F.Hroch (hroch@physics.muni.cz)

  This file is part of Munipack.

  Munipack is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.
  
  Munipack is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License
  along with Munipack.  If not, see <http://www.gnu.org/licenses/>.

*/

#include "version.h"
#include "mprocess.h"
#include <wx/wx.h>
#include <wx/app.h>
#include <wx/cmdline.h>
#include <wx/process.h>
#include <wx/event.h>
#include <queue>

enum { ID_NULL, ID_MDARK, ID_MFLAT, ID_DARK, ID_FLAT, ID_COLORING, ID_CTRAFO,
       ID_CONE, ID_ASTROMETRY, ID_PHOTOMETRY, ID_VOTABLE, ID_CALIBRATE,
       ID_LISTING, ID_FITS, ID_KOMBINE };


class MuniCmdLineParser: public wxCmdLineParser
{
public:
  MuniCmdLineParser(int,int,char **);
  wxArrayString GetParams() const;

};


class Munipack: public wxAppConsole
{
public:

  bool OnInit();
  int OnRun();
  void OnFinish(wxProcessEvent&);
  void SetEnvironment();

private:

  bool mdark(MuniCmdLineParser&);
  bool mflat(MuniCmdLineParser&);
  bool dark(MuniCmdLineParser&);
  bool flat(MuniCmdLineParser&);
  bool coloring(MuniCmdLineParser&);
  bool ctrafo(MuniCmdLineParser&);
  bool cone(MuniCmdLineParser&);
  bool astrometry(MuniCmdLineParser&);
  bool photometry(MuniCmdLineParser&);
  bool votable(MuniCmdLineParser&);
  bool fits(MuniCmdLineParser&);
  bool calibrate(MuniCmdLineParser&);
  bool listing(MuniCmdLineParser&);
  bool kombine(MuniCmdLineParser&);

  MuniPipe pipe;

};


MuniProcess * operator<< (MuniProcess *, const wxString&);

